﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Security;
using System.Web.SessionState;
using System.Web.Routing;

namespace VK.Casemeet.Web
{
    public class Global : System.Web.HttpApplication
    {

        void RegisterRouters(RouteCollection routes)
        {
            routes.MapPageRoute("", "", "~/Front/Default.aspx");
            routes.MapPageRoute("AreaDefault", "Default_{provinceID}_{cityID}.html", "~/Front/AreaDefault.aspx");

            routes.MapPageRoute("MemberLogin", "MemberLogin.html", "~/Front/MemberLogin.aspx");
            routes.MapPageRoute("MemberRegister", "MemberRegister.html", "~/Front/MemberRegister.aspx");
            routes.MapPageRoute("ActiveEmail", "ActiveEmail.html", "~/Front/ActiveEmail.aspx");
            routes.MapPageRoute("ActiveEmailComplete", "ActiveEmailComplete/{code}.html", "~/Front/ActiveEmailComplete.aspx");
            routes.MapPageRoute("FindPassFind", "FindPassFind.html", "~/Front/FindPassFind.aspx");
            routes.MapPageRoute("FindPassSend", "FindPassSend.html", "~/Front/FindPassSend.aspx");
            routes.MapPageRoute("FindPassEdit", "FindPassEdit/{code}.html", "~/Front/FindPassEdit.aspx");
            routes.MapPageRoute("FindPassComplete", "FindPassComplete.html", "~/Front/FindPassComplete.aspx");

            routes.MapPageRoute("ShopLogin", "ShopLogin.html", "~/Front/ShopLogin.aspx");
            routes.MapPageRoute("ShopRegister", "ShopRegister.html", "~/Front/ShopRegister.aspx");

            routes.MapPageRoute("ArticleList", "{provinceID}_{cityID}/ArticleList_{categoryID}.html", "~/Front/ArticleList.aspx");
            routes.MapPageRoute("ArticleDetail", "{provinceID}_{cityID}/ArticleDetail/{ArticleID}.html", "~/Front/ArticleDetail.aspx");

            routes.MapPageRoute("ShopList", "{provinceID}_{cityID}/ShopList.html/{*extrainfo}", "~/Front/ShopList.aspx");

            routes.MapPageRoute("Shop", "Shop_{ShopID}.html", "~/ShopFront/Default.aspx");
            routes.MapPageRoute("ShopLineList", "Shop_{ShopID}/LineList.html", "~/ShopFront/LineList.aspx");
            routes.MapPageRoute("ShopGroup", "Shop_{ShopID}/Group.html", "~/ShopFront/Group.aspx");
            routes.MapPageRoute("ShopTravelLogList", "Shop_{ShopID}/TravelLogList.html", "~/ShopFront/TravelLogList.aspx");
            routes.MapPageRoute("ShopTravelLogDetail", "Shop_{ShopID}/TravelLogDetail_{TravelLogID}.html", "~/ShopFront/TravelLogDetail.aspx");
            routes.MapPageRoute("ShopAlbumList", "Shop_{ShopID}/AlbumList.html", "~/ShopFront/AlbumList.aspx");
            routes.MapPageRoute("ShopAlbumDetail", "Shop_{ShopID}/AlbumDetail_{AlbumID}.html", "~/ShopFront/AlbumDetail.aspx");
            routes.MapPageRoute("ShopContact", "Shop_{ShopID}/Contact.html", "~/ShopFront/Contact.aspx");

            routes.MapPageRoute("LineList", "{provinceID}_{cityID}/LineList.html/{*extrainfo}", "~/Front/LineList.aspx");
            routes.MapPageRoute("LineDetail", "{provinceID}_{cityID}/LineDetail/{LineID}.html", "~/Front/LineDetail.aspx");

            routes.MapPageRoute("Group", "{provinceID}_{cityID}/Group.html/{*extrainfo}", "~/Front/Group.aspx");
            routes.MapPageRoute("GroupDetail", "{provinceID}_{cityID}/GroupDetail/{gcid}.html", "~/Front/GroupDetail.aspx");

            routes.MapPageRoute("AlbumList", "{provinceID}_{cityID}/AlbumList.html", "~/Front/AlbumList.aspx");
            routes.MapPageRoute("AlbumDetail", "{provinceID}_{cityID}/AlbumDetail_{AlbumID}.html", "~/Front/AlbumDetail.aspx");

            routes.MapPageRoute("EliteList", "{provinceID}_{cityID}/EliteList.html", "~/Front/EliteList.aspx");
            routes.MapPageRoute("EliteDetail", "{provinceID}_{cityID}/EliteDetail_{EliteID}.html", "~/Front/EliteDetail.aspx");

            routes.MapPageRoute("MagazineList", "{provinceID}_{cityID}/MagazineList.html", "~/Front/MagazineList.aspx");

            routes.MapPageRoute("Pages", "{provinceID}_{cityID}/Page_{PageID}.html", "~/Front/Pages.aspx");

            routes.MapPageRoute("SubmitReserve", "SubmitReserve/{LineID}.html", "~/Front/SubmitReserve.aspx");
        }

        void Application_Start(object sender, EventArgs e)
        {
            // 在应用程序启动时运行的代码
            RegisterRouters(RouteTable.Routes);

        }

        void Application_End(object sender, EventArgs e)
        {
            //  在应用程序关闭时运行的代码

        }

        void Application_Error(object sender, EventArgs e)
        {
            // 在出现未处理的错误时运行的代码

        }

        void Session_Start(object sender, EventArgs e)
        {
            // 在新会话启动时运行的代码

        }

        void Session_End(object sender, EventArgs e)
        {
            // 在会话结束时运行的代码。 
            // 注意: 只有在 Web.config 文件中的 sessionstate 模式设置为
            // InProc 时，才会引发 Session_End 事件。如果会话模式设置为 StateServer 
            // 或 SQLServer，则不会引发该事件。

        }

    }
}
